package org.base23.video.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * AI指导对话消息实体
 */
@Data
@TableName("ai_guidance_message")
public class AiGuidanceMessageEntity {

    /**
     * 消息ID
     */
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * 会话ID
     */
    @TableField("conversation_id")
    private String conversationId;

    /**
     * 发送者
     */
    @TableField("sender")
    private String sender;

    /**
     * 消息内容
     */
    @TableField("content")
    private String content;

    /**
     * 时间戳
     */
    @TableField("timestamp")
    private LocalDateTime timestamp;

    /**
     * 序列号
     */
    @TableField("sequence_number")
    private Integer sequenceNumber;

    /**
     * 消息类型
     */
    @TableField("message_type")
    private String messageType;

    /**
     * 元数据（JSON格式）
     */
    @TableField("metadata")
    private String metadata;

    /**
     * 消息发送者枚举
     */
    public enum MessageSender {
        USER("USER", "用户"),
        AI("AI", "AI助手");

        private final String code;
        private final String description;

        MessageSender(String code, String description) {
            this.code = code;
            this.description = description;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }
    }

    /**
     * 消息类型枚举
     */
    public enum MessageType {
        TEXT("TEXT", "文本消息"),
        IMAGE("IMAGE", "图片消息"),
        VIDEO("VIDEO", "视频消息"),
        ANALYSIS("ANALYSIS", "分析结果");

        private final String code;
        private final String description;

        MessageType(String code, String description) {
            this.code = code;
            this.description = description;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }
    }
} 